package com.example.sourcesprng.jdk8._optional;

import java.util.Optional;

public class OptionalTest {

    public static void main(String[] args) {
        Optional<Person> person = Person.getPerson(0);
        if (!person.isPresent()) {
            System.out.println("未获取到person对象");
            return;
        }
        Person person1 = person.get();
        person1.setAge(18);
        person1.setName("小夹子");
        System.out.println(person1.toString());
    }
}
